#ifndef DBSEARCHHELPER_H
#define DBSEARCHHELPER_H

#include "iostream"
#include "vector"
#include "QString"

class QTimer;
class GoodInfo;

class DBSearchHelper
{
private:
    DBSearchHelper();

private:
   static DBSearchHelper *instance;

public:
   static DBSearchHelper* GetInstance();

public:
   // 搜索数据
   void SearchGoodInfo(QString search_good_id);

   // 根据下标获取数据
   GoodInfo *GetGoodInfo(QString search_id);

   // 获取索引表
   std::vector<QString> *GetSearchList();

   void RefreshSearch(QString search_good_id);

private:
   void FirstTimeSearchGoodInfo(QString search_good_id);
   void Clear();

private:
   std::vector<GoodInfo>* m_all_search_good_infos;
   std::vector<QString>* m_cur_search_list;
   QTimer *m_timer;
   QString m_last_search_id;

};

#endif // DBSEARCHHELPER_H
